﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Windows.Controls;
using System.Globalization;

namespace RecommendatioNetwork.View.ValidationRules
{
    class TextNewCommentValidator : ValidationRule
    {

        public override ValidationResult Validate(object value, CultureInfo cultureInfo)
        {

            if (string.IsNullOrWhiteSpace(value.ToString()))
                return new ValidationResult(false, "Il commento non può essere vuoto");
            if ((value.ToString().Length < 10))
                return new ValidationResult(false, "Il commento non può contenere meno di dieci caratteri");
            return ValidationResult.ValidResult;

        }
    }
}
